import {getSpace,getPic,addItemName,handleListItem,handleItemNmae,handleDeleteImage} from './model'

// 获取列表
export async function getSpaceData(){
  const params = {order: "createTime", sort: "asc", page: 1, size: 20}
  const {data:{list}}:any = await getSpace(params)
  return list
}

// 根据id获取图片
export async function getPicData(ID:any){
  const params = {page: 1, size: 20, total: 0, classifyId: ID}
  const {data:{list}}:any = await getPic(params)
  return list
}

// 添加列表项
export async function addItemNameData(data) {
  const params = await addItemName(data)
  return params
}

// 删除数据列表
export async function handlePicture(data){
  const params = await handleListItem(data)
  return params
}

// 修改列表某一项名称
export async function handleditorName(data) {
  const params = await handleItemNmae(data)
  return params
}

export async function handleDleteImageItem(data){
  const params = await handleDeleteImage(data)
  return params
}